﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AppTrans
{
    public class Write2File
    {

        public static void Main(string text)
        {

            var debug_mode = RegistryKeyValues.GetValue("debug_mode");

            if ((string)debug_mode == null)
            {
                RegistryKeyValues.SetValue("debug_mode", "0");
               
            }

            if ((string)debug_mode == "1")
            {

                String LogFile = @"C:\AppTransDB\AppTransLog.txt";

                using (System.IO.StreamWriter file = new System.IO.StreamWriter(LogFile, true))
                {
                    file.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + " - " + text + "\r");
                }
            }

        }
    }
}
